<!--
 * createor: zc
 * email: zc8023zs@163.com
 * create_time: 2020/3/14 13:46:24
 *-->
<template>
  <el-container>
    <el-header>
      签到记录表详情
    </el-header>
    <el-main>
      <el-form label-width="200px" :inline="true" style="padding:5% 5% 0 5%">
        <el-form-item label="用户签到表：">
          <span>{{formData.id}}</span>
        </el-form-item>
        <el-form-item label="用户Id：">
          <span>{{formData.user_id}}</span>
        </el-form-item>
        <el-form-item label="累计签到天数：">
          <span>{{formData.signin_day}}</span>
        </el-form-item>
        <el-form-item label="当前签到获得积分：">
          <span>{{formData.get_score}}</span>
        </el-form-item>
        <el-form-item label="连续签到累计获得积分：">
          <span>{{formData.total_score}}</span>
        </el-form-item>
        <el-form-item label="签到时间：">
          <span>{{formData.add_time}}</span>
        </el-form-item>
        <el-form-item label="编号 记录用：">
          <span>{{formData.number}}</span>
        </el-form-item>
      </el-form>
    </el-main>
  </el-container>
</template>
<style scoped>
body .app-container .el-container,
body .app-container .el-header,
body .app-container .el-main,
body .el-container,
body .el-header,
body .el-main {
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
</style>
<script>
import { Loading } from "element-ui";
import {
  jbr_user_signinInfo
} from '@/api/project/wmyh/project_wmyh_jbr_user_signin'
export default {
  name: "a_wmyha_jbr_user_signin_info",
  data() {
    return {
      infoLoading: false,
      formData:{
        id: 0, 
        user_id: 0, 
        signin_day: 0, 
        get_score: 0, 
        total_score: 0, 
        add_time: '2020/8/11 10:52:38', 
        number: '', 
      }
    };
  },
  activated() {
    var result = location.search.match(new RegExp("[\?\&]id=([^\&]+)", "i"));
    if(result != null || result.length > 0){
      this.onInfo(result[1]);
    }
  },
  methods: {
    onInfo(id){
      this.infoLoading=true;
      jbr_user_signinInfo({id:id}).then(r=>{
        this.formData.id = r.dataSingle.id, 
        this.formData.user_id = r.dataSingle.user_id, 
        this.formData.signin_day = r.dataSingle.signin_day, 
        this.formData.get_score = r.dataSingle.get_score, 
        this.formData.total_score = r.dataSingle.total_score, 
        this.formData.add_time = r.dataSingle.add_time, 
        this.formData.number = r.dataSingle.number, 
        this.infoLoading=false;
      }).catch(()=>{
        this.infoLoading=false;
      });
    }
  }
}
</script>
